<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-JAVA: awtk.TEmitter类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-JAVA
   </div>
   <div id="projectbrief">AWTK JAVA API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>awtk</b></li><li class="navelem"><a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="classawtk_1_1_t_emitter-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">awtk.TEmitter类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 awtk.TEmitter 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classawtk_1_1_t_emitter.png" usemap="#awtk.TEmitter_map" alt=""/>
  <map id="awtk.TEmitter_map" name="awtk.TEmitter_map">
<area href="classawtk_1_1_t_file_chooser.html" alt="awtk.TFileChooser" shape="rect" coords="0,56,128,80"/>
<area href="classawtk_1_1_t_object.html" alt="awtk.TObject" shape="rect" coords="276,56,404,80"/>
<area href="classawtk_1_1_t_idle_info.html" alt="awtk.TIdleInfo" shape="rect" coords="0,112,128,136"/>
<area href="classawtk_1_1_t_native_window.html" alt="awtk.TNativeWindow" shape="rect" coords="138,112,266,136"/>
<area href="classawtk_1_1_t_object_array.html" alt="awtk.TObjectArray" shape="rect" coords="276,112,404,136"/>
<area href="classawtk_1_1_t_object_default.html" alt="awtk.TObjectDefault" shape="rect" coords="414,112,542,136"/>
<area href="classawtk_1_1_t_timer_info.html" alt="awtk.TTimerInfo" shape="rect" coords="552,112,680,136"/>
  </map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ae4e311959d07b2c5acb8a4a8aba394e0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#ae4e311959d07b2c5acb8a4a8aba394e0">TEmitter</a> (long <a class="el" href="classawtk_1_1_t_emitter.html#a3dfef6f3db53335a00cb479e90262840">nativeObj</a>)</td></tr>
<tr class="separator:ae4e311959d07b2c5acb8a4a8aba394e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe4f9d4a120ad6f3e81cafa2764fa601"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#abe4f9d4a120ad6f3e81cafa2764fa601">dispatch</a> (<a class="el" href="classawtk_1_1_t_event.html">TEvent</a> e)</td></tr>
<tr class="separator:abe4f9d4a120ad6f3e81cafa2764fa601"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf6b367450ff271497e535debed153d2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#abf6b367450ff271497e535debed153d2">dispatchSimpleEvent</a> (<a class="el" href="enumawtk_1_1_t_event_type.html">TEventType</a> type)</td></tr>
<tr class="separator:abf6b367450ff271497e535debed153d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa171587ffc71117e6f4fa66ad19eb571"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#aa171587ffc71117e6f4fa66ad19eb571">on</a> (<a class="el" href="enumawtk_1_1_t_event_type.html">TEventType</a> type, TOnEvent on_event, long ctx)</td></tr>
<tr class="separator:aa171587ffc71117e6f4fa66ad19eb571"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4515856b77cd3f885a2fd628e4801ab7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#a4515856b77cd3f885a2fd628e4801ab7">off</a> (int id)</td></tr>
<tr class="separator:a4515856b77cd3f885a2fd628e4801ab7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac74c2f4cb04791b650ad9c54b2b13707"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#ac74c2f4cb04791b650ad9c54b2b13707">enable</a> ()</td></tr>
<tr class="separator:ac74c2f4cb04791b650ad9c54b2b13707"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a943c4ba9c3a7feb93e02a6fa8f0ed834"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#a943c4ba9c3a7feb93e02a6fa8f0ed834">disable</a> ()</td></tr>
<tr class="separator:a943c4ba9c3a7feb93e02a6fa8f0ed834"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad364c5d5d92602311d4c3e533e8ae646"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#ad364c5d5d92602311d4c3e533e8ae646">size</a> ()</td></tr>
<tr class="separator:ad364c5d5d92602311d4c3e533e8ae646"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a363332f4f679bcb99af877bc4f161097"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#a363332f4f679bcb99af877bc4f161097">destroy</a> ()</td></tr>
<tr class="separator:a363332f4f679bcb99af877bc4f161097"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a22052354ddd6d3e7a5ae7ce0fa3654a6"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#a22052354ddd6d3e7a5ae7ce0fa3654a6">cast</a> (long <a class="el" href="classawtk_1_1_t_emitter.html#a3dfef6f3db53335a00cb479e90262840">nativeObj</a>)</td></tr>
<tr class="separator:a22052354ddd6d3e7a5ae7ce0fa3654a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a068f5e211a8daecdfa4b784e5591ac35"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#a068f5e211a8daecdfa4b784e5591ac35">create</a> ()</td></tr>
<tr class="separator:a068f5e211a8daecdfa4b784e5591ac35"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77409663ac9dc08f2625dd38b6120f44"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#a77409663ac9dc08f2625dd38b6120f44">cast</a> (<a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a> emitter)</td></tr>
<tr class="separator:a77409663ac9dc08f2625dd38b6120f44"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:a3dfef6f3db53335a00cb479e90262840"><td class="memItemLeft" align="right" valign="top">long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_emitter.html#a3dfef6f3db53335a00cb479e90262840">nativeObj</a></td></tr>
<tr class="separator:a3dfef6f3db53335a00cb479e90262840"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>事件分发器, 用于实现观察者模式。 </p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="ae4e311959d07b2c5acb8a4a8aba394e0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4e311959d07b2c5acb8a4a8aba394e0">&#9670;&nbsp;</a></span>TEmitter()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">awtk.TEmitter.TEmitter </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>nativeObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>通过nativeObj构造Java对象。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">nativeObj</td><td>原生对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的Java对象。 </dd></dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a22052354ddd6d3e7a5ae7ce0fa3654a6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a22052354ddd6d3e7a5ae7ce0fa3654a6">&#9670;&nbsp;</a></span>cast() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a> awtk.TEmitter.cast </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>nativeObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>把nativeObj转换层Java对象。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">nativeObj</td><td>原生对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的Java对象。 </dd></dl>

<p>被 <a class="el" href="classawtk_1_1_t_object_array.html#aff10e70b85effef310cceb64edc006f1">awtk.TObjectArray</a>, <a class="el" href="classawtk_1_1_t_object_default.html#a540eeea212bef35e9e565a08cb75c9b2">awtk.TObjectDefault</a>, <a class="el" href="classawtk_1_1_t_file_chooser.html#a3c1aebee88a59cb0006a2f6f3054f5df">awtk.TFileChooser</a>, <a class="el" href="classawtk_1_1_t_idle_info.html#a15abd94e89d5c5ae6bd9728649310044">awtk.TIdleInfo</a>, <a class="el" href="classawtk_1_1_t_native_window.html#a738923f6f493dd55695092f6f3317947">awtk.TNativeWindow</a>, <a class="el" href="classawtk_1_1_t_object.html#a6b977217383a5f374a04379b4cfc7066">awtk.TObject</a> , 以及 <a class="el" href="classawtk_1_1_t_timer_info.html#abf4ef80c28924deb3d761f9de5138e3d">awtk.TTimerInfo</a> 重载.</p>

</div>
</div>
<a id="a77409663ac9dc08f2625dd38b6120f44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77409663ac9dc08f2625dd38b6120f44">&#9670;&nbsp;</a></span>cast() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a> awtk.TEmitter.cast </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a>&#160;</td>
          <td class="paramname"><em>emitter</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>转换为emitter对象(供脚本语言使用)。</p>
<p>主要给脚本语言使用。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">emitter</td><td>emitter对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="a068f5e211a8daecdfa4b784e5591ac35"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a068f5e211a8daecdfa4b784e5591ac35">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_t_emitter.html">TEmitter</a> awtk.TEmitter.create </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建emitter对象。</p>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

<p>被 <a class="el" href="classawtk_1_1_t_object_array.html#ad3c8adeab0dc988aba3b2c441fdb705d">awtk.TObjectArray</a>, <a class="el" href="classawtk_1_1_t_object_default.html#a17b7e88ff32f208e064f970547cbb52e">awtk.TObjectDefault</a> , 以及 <a class="el" href="classawtk_1_1_t_file_chooser.html#af92f440578bf7c143b2364cd29bdde00">awtk.TFileChooser</a> 重载.</p>

</div>
</div>
<a id="a363332f4f679bcb99af877bc4f161097"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a363332f4f679bcb99af877bc4f161097">&#9670;&nbsp;</a></span>destroy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TEmitter.destroy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>销毁。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a943c4ba9c3a7feb93e02a6fa8f0ed834"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a943c4ba9c3a7feb93e02a6fa8f0ed834">&#9670;&nbsp;</a></span>disable()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TEmitter.disable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>禁用。</p>
<p>禁用后emitter_dispatch无效，但可以注册和注销。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="abe4f9d4a120ad6f3e81cafa2764fa601"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abe4f9d4a120ad6f3e81cafa2764fa601">&#9670;&nbsp;</a></span>dispatch()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TEmitter.dispatch </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classawtk_1_1_t_event.html">TEvent</a>&#160;</td>
          <td class="paramname"><em>e</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>分发事件。如果当前分发的回调函数返回RET_REMOVE，该回调函数将被移出。 禁用状态下，本函数不做任何事情。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">e</td><td>事件对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>如果当前分发的回调函数返回RET_STOP，dispatch中断分发，并返回RET_STOP，否则返回RET_OK。 </dd></dl>

</div>
</div>
<a id="abf6b367450ff271497e535debed153d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf6b367450ff271497e535debed153d2">&#9670;&nbsp;</a></span>dispatchSimpleEvent()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TEmitter.dispatchSimpleEvent </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="enumawtk_1_1_t_event_type.html">TEventType</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>分发事件。 </p><blockquote class="doxtable">
<p>对emitter_dispatch的包装，分发一个简单的事件。 </p>
</blockquote>
<p>如果当前分发的回调函数返回RET_STOP，dispatch中断分发，并返回RET_STOP，否则返回RET_OK。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>事件类型。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="ac74c2f4cb04791b650ad9c54b2b13707"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac74c2f4cb04791b650ad9c54b2b13707">&#9670;&nbsp;</a></span>enable()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TEmitter.enable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>启用。</p>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a4515856b77cd3f885a2fd628e4801ab7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4515856b77cd3f885a2fd628e4801ab7">&#9670;&nbsp;</a></span>off()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TEmitter.off </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>注销指定事件的处理函数。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">id</td><td>emitter_on返回的ID。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="aa171587ffc71117e6f4fa66ad19eb571"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa171587ffc71117e6f4fa66ad19eb571">&#9670;&nbsp;</a></span>on()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int awtk.TEmitter.on </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="enumawtk_1_1_t_event_type.html">TEventType</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TOnEvent&#160;</td>
          <td class="paramname"><em>on_event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>ctx</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>注册指定事件的处理函数。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>事件类型。 </td></tr>
    <tr><td class="paramname">on_event</td><td>事件处理函数。 </td></tr>
    <tr><td class="paramname">ctx</td><td>事件处理函数上下文。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回id，用于emitter_off。 </dd></dl>

</div>
</div>
<a id="ad364c5d5d92602311d4c3e533e8ae646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad364c5d5d92602311d4c3e533e8ae646">&#9670;&nbsp;</a></span>size()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int awtk.TEmitter.size </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>获取注册的回调函数个数，主要用于辅助测试。</p>
<dl class="section return"><dt>返回</dt><dd>回调函数个数。 </dd></dl>

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="a3dfef6f3db53335a00cb479e90262840"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3dfef6f3db53335a00cb479e90262840">&#9670;&nbsp;</a></span>nativeObj</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long awtk.TEmitter.nativeObj</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>原生对象。 </p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/TEmitter.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
